package net.sf.xmlform.springmvcexample.user;

import net.sf.xmlform.config.annotation.Field;
import net.sf.xmlform.config.annotation.Form;
import net.sf.xmlform.config.annotation.Facets;
import net.sf.xmlform.config.annotation.Check;

@Form
public class User {
	@Field(label="编码",required="1",facets=@Facets(minLength=3,maxLength=8))
	private String code;
	@Field(label="性别",required="1",facets=@Facets(enums="男,女"))
	private String gender;
	@Field(label="密码",required="1")
	private String password;
	@Field(label="体育",required="gender=='男'",facets=@Facets(enums="足球,篮球"))
	private String sports;
	@Field(label="衣服",required="gender=='女'",facets=@Facets(maxLength=20))
	private String clothes;
	@Field(label="年龄")
	private Integer age;
	@Field(label="收入",required="notnull(age)",
			checks= {@Check(exp="value()>age*3 && value()<age*5",text="收入必须在年龄的3倍与5倍之间")}
	)
	private Integer income;
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getSports() {
		return sports;
	}
	public void setSports(String sports) {
		this.sports = sports;
	}
	public String getClothes() {
		return clothes;
	}
	public void setClothes(String clothes) {
		this.clothes = clothes;
	}
	public Integer getAge() {
		return age;
	}
	public void setAge(Integer age) {
		this.age = age;
	}
	public String getGender() {
		return gender;
	}
	public void setGender(String gender) {
		this.gender = gender;
	}
	public Integer getIncome() {
		return income;
	}
	public void setIncome(Integer income) {
		this.income = income;
	}
	
}
